from scipy.optimize import minimize_scalar

# 定义函数
def f(x):
    return x**2 - 3*x

# 寻找极小值
res = minimize_scalar(f)
min_x = res.x
min_y = f(min_x)

print(f"函数的极小值点为 x = {min_x}，极小值为 y = {min_y}")